home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
The World of Computer Software
/
The World of Computer Software.iso
/
pbaseiv.zip
/
P4UTL003.TIP
< prev
next >
Wrap
Text File
|
1991-12-16
|
4KB
|
96 lines
Batch file users complain justifiably about the ECHO
command's slowness. The problem is most obvious in batch
files that create full-screen displays.
To overcome ECHO's sluggishness, I wrote a BASIC program,
MAKEMENU.BAS. The program creates a COM file that displays
up to 24 lines of text.
Run MAKEMENU, and either press <Enter> to accept the default
file name MENU.COM or enter another name (you don't have to
enter the COM extension). Next, enter up to 24 lines of text
to be displayed on screen. To enter a blank line, type a
space before pressing <Enter>. Don't enter any dollar signs
($) anywhere in any of your menus, as this program uses DOS
function 9, which interprets that character as the end of a
string. After pressing <Enter> at the end of each line, type
N for normal display, C for centered, or R for
right-justified output.
When you are through typing, press <Enter> at the start of a
new line. You can then insert a call to the generated COM
file into your batch program.
Vincent D. O'Connor
Babbitt, Minnesota
Editor's note: The file MAKEMENU.BAS appears in the P4UTIL
directory of your PowerBase *.* Volume IV diskette. In
addition to boosting display speed, MAKEMENU lets you
display < and > characters in menus, which the DOS ECHO
command won't do unless you enclose them in quotes. Also,
COM files are more difficult to modify than batch files and
therefore useful for displaying copyrights and disclaimers
that you don't want people to change easily.
To run MAKEMENU, use one of the following commands:
Your BASIC Command
---------- -------
BASICA BASICA MAKEMENU.BAS
(or clone)
GWBASIC GWBASIC MAKEMENU.BAS
QBasic QBASIC /RUN MAKEMENU.BAS
(from DOS 5)
In most versions of BASIC, you can insert a blank line in
your menu by entering a space and pressing <Enter> when
you're asked for a line. But on others, this has the same
effect as pressing <Enter> on its own--MAKEMENU assumes
you're finished creating that menu and asks if you want to
create another. If you have this problem, you can create a
blank line as follows: hold down the <Alt> key, type 255 on
the numeric keypad, release <Alt>, and press <Enter>.
If you want, you can store input for MAKEMENU in a text file
and use redirection to get MAKEMENU to process that file.
The listing below (TEST.TXT) shows a sample input file. The
first line should be the COM file name you want to create.
The next 24 lines are strings to display. Starting with the
second line, the first character of each line should be an
`N', `C', or `R' to format the preceding (not the current)
line. The next to last line should have only one of those
three characters. `N' must appear by itself on the last
line. If the text file is named TEST.TXT, you can submit it
to MAKEMENU by adding "< TEST.TXT" to the line you use to
invoke MAKEMENU normally.
Postscript: The version of MAKEMENU that originally appeared
in PC World had syntax and type compatibility errors that
caused it to fail when run under QBASIC. The version on the
PowerBase *.* Volume IV disk corrects these problems.
TEST.TXT: A sample input file that can be passed to MAKEMENU
via redirection. (Extract with Alt-F)
---- BEGIN LISTING ----
testmenu.com
My Menu
C===========================
C: 1. Run a program :
C: 2. Play a game :
C: 3. Exit :
C===========================
C
N
---- END LISTING ----
Title: Giving ECHO a Boost
Category: DOS
Issue date: Mar 1991
Editor: Tom Swan
Supplementary files: P4UTIL\MAKEMENU.BAS